package com.Interface.pa;

import java.util.Scanner;

public class SignUp {
    public static void signUp(){
        boolean isFlag = true;
        do {
            Scanner scanner = new Scanner(System.in);
            System.out.println("\n请输入用户名: ");
            String inputName = scanner.next();
            System.out.println("请输入密码: ");
            String inputPassword1 = scanner.next();
            System.out.println("请再次输入密码: ");
            String inputPassword2 = scanner.next();
            if (inputName.length() < 3 && inputPassword1.length() < 6){
                System.out.println("户名长度不能小于3,密码长度不能小于6!");
                System.out.println("户名长度不能小于3");
            } else if (inputName.length() < 3 && inputPassword1.length() >= 6) {
                System.out.println("户名长度不能小于3");
            } else if (inputName.length() > 3 && inputPassword1.length() < 6) {
                System.out.println("密码长度不能小于6!");
            } else {
                if(!inputPassword1.equals(inputPassword2)){
                    System.out.println("两次输入的密码不相同!");
                } else if (inputPassword1.equals(inputPassword2)) {
                    System.out.println("注册成功！");
                    isFlag = false;
                }
            }
        }while (isFlag);
    }

    public static void main(String[] args) {
        System.out.println("*********欢迎进入注册系统*********");
        signUp();
    }
}
